import { NEWS_SET_LIST } from '../action/actionType'
// 4. 定义news.js作为reducer，定义state.list
const initialState = {
    list: [],
};

export default function newsReducer(state = initialState, { type, payload }) {
    switch (type) {
        case NEWS_SET_LIST:
            return {
                ...state,
                list: [...payload],
            };

        default:
            return state;
    }
}